<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: id
  Date: 2020/12/30
  Time: 14:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page  isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../util/makerAndenterGoodAndselect1.jsp"%>
<html>
<head>
    <title>Show EnterGood</title>
    <style type="text/css">
        /*进货订单*/
        #center{
            width: 1288px;
            height:60px;
            position: absolute;
            top: 60px;
            left: 83px;

        }

        /*from表单*/
        .ctop{
            position: relative;
            left: 44px;
            top: 10px;
            border-radius: 10px;
            width: 1200px;
            height: 40px;
            box-sizing: border-box;
            padding-top: 5px;
            padding-left: 15px;
            border: 1px solid paleturquoise;
        }

        #tab{
            box-sizing: border-box;
            padding-left: 96px;
            width: 1288px;
            height: 300px;
            position: absolute;
            top: 115px;
            left: 2px;

        }
        .p{
            float: left;
            width: 55px;
            text-align: center;
            height: 40px;
        }
        .p:hover{
            background-color: rgb(192,192,192);
        }

    </style>
    <script type="text/javascript" src="../../../static/jquery-3.4.1.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#tab").hover(function () {
                $("#d4").hide()
                $("#xs").hide()
                $("#d3").hide()
                $("#d4").hide()
            })

        })
        /*删除*/
        function del(eid) {
            var url="${pageContext.request.contextPath}/EnterGood/del?eid="+eid;
            if(confirm("您确认删除吗?")){
                location.href=url;
                return true;
            }else {
                return  false;
            }
        }


        /*入库操作*/
        function enter(eid) {
            var url="${pageContext.request.contextPath}/EnterGood/enter?eid="+eid;
            if(confirm("您确认入库吗?")){
                location.href=url;
                return true;
            }else {
                return  false;
            }

        }

        /*退货操作*/
        function out2(eid) {
            var url="${pageContext.request.contextPath}/EnterGood/out?eid="+eid;
            if(confirm("您确认退货吗?")){
                location.href=url;
                return true;
            }else {
                return  false;
            }

        }
    </script>

</head>
<body>
<!--************************************************************************************************************************-->
<!--查询的文本框上半部分-->
<div id="center">
    ${msg}
    <!--上面部分的查询-->
    <div class="ctop">
        <form action="${pageContext.request.contextPath}/EnterGood/EnterPageGood">
            <!--根据订单编号查-->
            <input type="text" name="document" placeholder="根据编号查询" style="width: 230px;border-radius: 6px;height: 1.7em;text-indent: 1em" value="${document}">
            <input type="submit" value="搜索" style="width: 90px;height: 2em;background-color: rgb(64,158,244);border-radius: 6px">
<c:if test="${sessionScope.boosUser!=null || sessionScope.resUser!=null}">
            <button id="btn" style="width: 100px;height: 2em;border-radius: 7px;margin-left: 740px">
                <a href="${pageContext.request.contextPath}/EnterGood/addEnterGood">
                    新增订货订单
                </a>
            </button>
</c:if>
        </form>
</div>

<%--表格展示部分--%>

<div id="tab">
    <table style="width: 1100px;height: 180px;text-align: center" border="1" >
        <tr>
            <td>编号</td>
            <td>业务日期</td>
            <td>处理状态</td>
            <td>审核人</td>
            <td>供应商名称</td>
            <td>商品类型</td>
            <td>订单商品</td>
            <td>商品数量</td>
            <td>应付金额</td>
            <td>操作</td>
        </tr>
        <c:if test="${ not emptyrequestScope.page.list}">
        <c:forEach var="list" items="${requestScope.page.list}">
            <tr>
                <input type="hidden" name="eid" value="${list.eid}">
                <input type="hidden" name="rid" value="${list.rid}">
                <input type="hidden" name="stores" value="${list.stores}">
                <input type="hidden" name="goodStyle" value="${list.goodStyle}">
                <td>${list.document}</td>
                <td>
                    <fmt:formatDate value="${list.data1}" pattern="yyyy/MM/dd "/>
                </td>
                <td>
                    <c:if test="${list.okandno==0}">
                        <span style="color: red">未入库</span>
                    </c:if>
                    <c:if test="${list.okandno==1}">
                        <span style="color: blueviolet">已入库</span>
                    </c:if>
                </td>
                <td>${list.boss}</td>
                <td>
                    <c:if test="${list.forname==1}">
                        大田商家
                    </c:if>
                    <c:if test="${list.forname==2}">
                        允乐商家
                    </c:if>
                </td>
                <td>
                    <c:if test="${list.goodStyle==1}">
                    电子类型
                    </c:if>
                    <c:if test="${list.goodStyle==2}">
                        食物类型
                    </c:if>
                    <c:if test="${list.goodStyle==3}">
                        生活类型
                    </c:if>
                </td>
                <td>${list.goodname}</td>
                <td>${list.num}</td>
                <td>${list.money}</td>
                <td>
                    <a href="${pageContext.request.contextPath}/enterGoods/findAll?rid=${list.rid}&goodstyle=${list.goodStyle}&eid=${list.eid}&document=" title="查看详情">
                        <img src="../../../static/img/....png" alt="查看详情">
                    </a>

                    <c:if test="${list.goodname!=null}">

                    <c:if test="${sessionScope.boosUser!=null}">
                    <%--入库--%>
                    <a href="javascript:enter(${list.eid})" title="入库">
                        <img src="../../../static/img/update.png" alt="入库">
                    </a>
                    </c:if>

                        <%--出库--%>
                    <c:if test="${sessionScope.boosUser!=null}">
                    <a href="javascript:out2(${list.eid})" title="退货">
                        <img src="../../../static/img/update2.png" alt="退货">
                    </a>
                    </c:if>
                    </c:if>


<c:if test="${list.okandno==0}">
                    <%--删除--%>
                    <a href="javascript:del(${list.eid})" title="删除订单">
                        <img src="../../../static/img/delete.png" alt="删除订单">
                    </a>
</c:if>
                </td>
            </tr>
        </c:forEach>
        </c:if>
    </table>

    <%--page--%>
    <div id="pa" style="width: 500px;height: 50px;margin-top: 30px">
        <div class="p">
            <a href="${pageContext.request.contextPath}/EnterGood/EnterPageGood?start=${page.curryPage-1}&document=${document}">上一页</a>
        </div>
        <c:forEach begin="1" end="${page.totalPae}" var="a">
            <div class="p">
                <a href="${pageContext.request.contextPath}/EnterGood/EnterPageGood?start=${a}&document=${document}">${a}</a>
            </div>
        </c:forEach>


        <div class="p">
            <a href="${pageContext.request.contextPath}/EnterGood/EnterPageGood?start=${page.curryPage+1}&document=${document}">下一页</a>
        </div>

        <div class="p" style="width: 200px">
            <span>第${page.curryPage}/${page.totalPae}页</span>
            <span>共${page.totalCount}条记录,</span>
        </div>
    </div>
</div>
</div>



</body>
</html>
